﻿@model S4Store.Models.Report.CarBrandTimeRateModel
@{
    Layout = null;
    ViewBag.Title = "CarBrandTimeRate";

        S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
        ChartModel.Name = "分车型销量时间进度差";
        ChartModel.YAxis = "进度百分比(%)";
        foreach (var report in Model.Reports)
        {
            ChartModel.XAxis.Add(report.CarBrand.Name);
        }
        //ChartModel.Width = 500;
        ChartModel.Height = 300;
        //ChartModel.XAxis.Add("销售进度");
        //ChartModel.XAxis.Add("订单进度");

        S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "销售进度";
        foreach (var report in Model.Reports)
        {
            series1.Data.Add(report.SaleRate);
        }
        ChartModel.Serieses.Add(series1);


        S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
        series2.Name = "时间进度";
        foreach (var report in Model.Reports)
        {
            series2.Data.Add(report.RateOfTime);
        }
        ChartModel.Serieses.Add(series2);
}
<script type="text/javascript">
    $(function () {
        var $c = $("#myContentArea");
        var count = $("#myContentArea").find("table td").has(".value").size();
        var right = parseInt($("#right").css("width").replace("px", "")) - 20;
        if (count * 190 + 70 >= right) {
            $c.width(count * 190 + 70);
        }
    });
</script>
<div style="height: 100%; width: 100%; overflow: auto;">
<div id="myContentArea" style="overflow:hidden">
    @Html.Action("ReportBar", "Common", Model.BarModel)
    <div style="position:relative; width:100%">
          
        @Html.Partial("../Chart/Column", ChartModel)
        <div>
            <div style=" margin-left:70px; overflow:hidden">
                <table style="width:100%">
                    <tr>
                        @foreach (var report in Model.Reports)
                        {
                            var diff = report.SaleAmountDiff;
                            <td align="center">
                                @if (diff < 0)
                                {
                                    <a class="specialRed"  href="@Url.Action("CarModelTimeRate", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd"), SearchCarBrandId = report.CarBrand.Id })" target="navtab" title="实际销量与应时销量的差值" tip="@(report.CarBrand.Name)销量时间进度差">
                                        <div class="value">@diff.AutoRound()</div>
                                        <div class="rt">实时销量：@report.GiveCarCount</div>
                                        <div class="rb">应时销量：@report.SaleExpectTarget.AutoRound()</div>
                                    </a>
                                }
                                else
                                {
                                    <a class="specialGreen"  href="@Url.Action("CarModelTimeRate", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd"), SearchCarBrandId = report.CarBrand.Id })" target="navtab" title="实际销量与应时销量的差值"  tip="@(report.CarBrand.Name)销量时间进度差">
                                        <div class="value">@diff.AutoRound()</div>
                                        <div class="rt">实时销量：@report.GiveCarCount</div>
                                        <div class="rb">应时销量：@report.SaleExpectTarget.AutoRound()</div>
                                    </a>
                                }
                            </td>
                        }
                    </tr>
                </table>
            </div>
        </div>
        
        <br />
        <table  style="border-collapse:collapse; width:100%" class="reporttable vmiddle">
 
            <tr>
                <th colspan="3">当日累计有望客户数</th>
                <th colspan="4">当日有望客户数</th>
                <th rowspan="3">集客缺口</th>
                <th rowspan="3">当前预估订单</th>
                <th rowspan="3">预估订单差距</th>
            </tr>
            <tr>
                <th rowspan="2">H级</th>
                <th rowspan="2">A级</th>
                <th rowspan="2">B级</th>
                <th colspan="3">当日新增</th>
                <th rowspan="2">本月累积</th>
            </tr>
            <tr>
                <th>H级</th>
                <th>A级</th>
                <th>B级</th>
            </tr>
            <tr>
                <td>@Model.Report.HYWKH</td>
                <td>@Model.Report.AYWKH</td>
                <td>@Model.Report.BYWKH</td>
                @{Model.Report.ShowLastDay(true);}
                <td>@Model.Report.HDJKH</td>
                <td>@Model.Report.ADJKH</td>
                <td>@Model.Report.BDJKH</td>
                @{Model.Report.ShowLastDay(false);}
                <td>@Model.Report.RegisterCustomerCount</td>
                <td>@Model.Report.JKQK.AutoRound()</td>
                <td>@Model.Report.YGDD</td>
                <td @S4Store.Utils.GetBgColor(Model.Report.YGDDCJ >= 0)>@Model.Report.YGDDCJ</td>
            </tr>
        </table>
        <br />   
        
    
    </div>
</div>
</div>